<template>
  <view :style="{
    'paddingTop':loading?'30rpx':0
  }">
    <view v-if="loading" class="custom-loader"></view>
    <view v-else class="loading-text">
      到底咯 (,,•́ . •̀,,)
    </view>
  </view>
</template>

<script setup>
import {ref} from 'vue';

const loading = ref(false);
const start = () => {
  loading.value = true;
}
const stop = () => {
  loading.value = false;
}
defineExpose({
  stop,
  start
})
</script>

<style>

.loading-text {
  color: #8a8a8a;
  font-size: 26rpx;
  text-align: center;
  padding: 40rpx;
}

/* CSS3加载动画 */
.custom-loader {
  width: 70rpx;
  height: 70rpx;
  margin: auto;
  border-radius: 50%;
  background: radial-gradient(farthest-side, #8210F4 94%, #0000) top/8px 8px no-repeat,
  conic-gradient(#0000 30%, #8210F4);
  -webkit-mask: radial-gradient(farthest-side, #0000 calc(100% - 8px), #000 0);
  animation: s3 1s infinite linear;
}

@keyframes s3 {
  100% {
    transform: rotate(1turn)
  }
}
</style>
